<{include file='customer/head.html'}>
<link rel="stylesheet" href="/static/js/plugins/layui/css/layui.css" media="all">
<style type="text/css">
	body .layui-rate{padding: 0;}
	body .layui-rate li{margin: 0;}
</style>
<body>
	<div class="akrPop">
		<form id="frm" action="" target="f" method="post" enctype="multipart/form-data">
			<ul class="ulForm">
				<li>
					<label class="form-label">名称：</label>
					<div class="form-input">
						<input name="name" value="<{$list.name}>" class="inputText">
					</div>
				</li>
				<li>
					<label class="form-label">星级：</label>
					<div class="form-input">
						<input type="hidden" name="star" value="<{$list.star}>">
						<div id="star"></div>
					</div>
				</li>
				<li>
					<label class="form-label">销售：</label>
					<div class="form-input">
						<select name="saleuid">
							<{foreach from=$saleuserlist item=vo}>
								<option value="<{$vo.id}>" <{if $list["saleuid"]==$vo["id"]}>selected<{/if}>><{$vo.displayname}></option>
							<{/foreach}>
						</select>
					</div>
				</li>
				<li>
					<label class="form-label">备注：</label>
					<div class="form-input">
						<textarea name="remark"><{$list.remark}></textarea>
					</div>
				</li>
				<li>
					<div class="form-input">
						<input type="hidden" name="id" value="<{$list.id}>">
						<input type="button" onclick="edit()" status="0" value="提交" class="akrBtn akrBtn-md blue">
					</div>
				</li>
			</ul>
		</form>
	</div>
	<script src="/static/js/plugins/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript">
		layui.use(['rate'], function(){
			var rate = layui.rate;
			rate.render({
				elem: '#star'
				,value: <{$list.star}>
				,theme: '#FF8000' //自定义主题色
				,choose: function(value){
					$("input[name='star']") .val(value);
				}
			  });
		})
		var addstatus=true;
		function edit(){
			var data = $("form").serialize();
			var href='../CustomerIndex/edit';
			if(addstatus){
                addstatus = false;
                _ajaxs.post(href,data,function _return(hdata)<{literal}>{
                    if(hdata.status){
                        _layer_admin.successMsg(hdata.message,function(){
                            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                            parent.layer.close(index);
                            parent.location.reload();
                        });
                    }else{
                        addstatus = true;
                        _layer_admin.successMsg(hdata.message);
                    }
                }<{/literal}>)
            }
		}
	</script>
</body>
</html>